package com.itheima.mapper;

import com.itheima.pojo.Dish;
import com.itheima.vo.UserDishVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Set;

/**
 * @author :WuJunJie
 * packageName :com.itheima.mapper
 * fileName :DishMapper
 * creationTime :2022-11-23 13:57
 */
@Mapper
public interface DishMapper {
    Integer insertDish(@Param("dish") Dish dish);

    Integer deleteDish(@Param("ids") List<String> ids);

    Integer updateDish(@Param("dish") Dish dish);

    Integer changeStatus(@Param("status")Integer status,@Param("ids") List<String> ids, @Param("updateTime")LocalDateTime updateTime,@Param("updateUser")String updateUser);

    Dish selectById(@Param("id") String id);

    List<Dish> selectPage(@Param("name") String name, @Param("start") Integer start,@Param("pageSize") Integer pageSize);

    List<Dish> selectByCategoryId(@Param("categoryId") String categoryId);

    Integer countTotal(@Param("name") String name);

    List<Dish> selectByCategoryIdAndStatus(@Param("categoryId") String categoryId,
                                           @Param("status") Integer status);

    List<Dish> selectByids(@Param("dishIds") Set<String> dishIds);
}
